﻿@model IEnumerable<EasyBlog.Models.InfoBlog>

@{
    ViewData["Title"] = "我的博客";
    int rowindex = 0;
}

<h1>@ViewData["Title"]</h1>
<script src="~/lib/jquery/dist/jquery.js"></script>

<script type="text/javascript">

    //alert("11");
    //$(function () {

    //    alert("11");
    //       var strHtml = "";
    //    $.post("/Blog/GetImg", { userName: "xlp" }, function (data) {
    //        var list = eval("(" + data + ")");
    //        var imageData = 'data:image/png;base64,' + list['BaseData'];
    //          strHtml=`<img src=${imageData} id="img-change" alt="" style="width:100px;height:100px;border-radius:50%;overflow:hidden">`
    //             alert(strHtml);
    //        $("#ViewImg").append(strHtml);
    //        // var imgWindow = $("#imgDetail").html("<img src="+imageData+">");
    //        // $("#headImage").html('<img src="data:image/png;base64,' + ret.data + '"/>')

    //    });
    //});



</script>
<p>
    <a asp-action="Create">新增</a>
</p>
@*<div id="ViewImg"></div>*@

<table class="table" style="text-align:center">
    <thead>
        <tr>
            <th>#</th>
            <th style="text-align:left">
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.VisitCount)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DTCreate)
            </th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            rowindex++;
            <tr>
                <td>@rowindex</td>
                <td style="text-align:left">
                    @Html.DisplayFor(modelItem => item.Title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.VisitCount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.DTCreate)
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.ID">编辑</a> |
                    <a asp-action="Delete" asp-route-id="@item.ID">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>
